//
//  CGPointEx.m
//  STM
//
//  Created by  xuchen(陈旭)， xichen(陈曦)， qq：511272827 on 10-10-22.
//  Copyright 2010 cc_team.com. All rights reserved.
//
#include "CCAll.h"

#ifdef	OBJC_MACRO
#import "CCCGPoint.h"

@implementation CGPointEx

//判断某个点是否在某个区域里
+ (BOOL)isInRect:(CGPoint)p rect:(CGRect)rect
{
	CGFloat rectX = rect.origin.x;
	CGFloat rectY = rect.origin.y;
	CGFloat rectWidth = rect.size.width;
	CGFloat rectHeight = rect.size.height;
	
	CGFloat pX = p.x;
	CGFloat pY = p.y;
	
	if(pX < rectX 
	||(pX > rectX + rectWidth)
	|| pY < rectY
	|| pY > rectY + rectHeight)
	{
		return FALSE;
	}
	
	return TRUE;
}

@end

#endif	//OBJC_MACRO
